<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title>添加门店</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 140px!important;
        }
    </style>
</head>

<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">品牌门店</span>
            <span class="line">/</span>
            <span class="current" ><a href="/shop/brandStore/list?type=0">门店管理</a></span><span class="line">/</span>
            添加门店
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form method="post" action="${base}/shop/brandStore/save"  class="form-horizontal form-validate">
                        <input type="hidden" name="brandStore.type" value="0">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>门店名称</label>
                            <div class="col-sm-3">
                                <input type="text"  name="brandStore.business_name" placeholder="" value="" class="form-control light-input" maxlength="15" required>
                            </div>
                            <span class="color_hint">不超过15个字符</span>
                        </div>
                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">分店名称：</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.branch_name" value="" class="form-control light-input" maxlength="10" required="true">
                            </div>
                            <span class="help-block"><span class="maroon">*</span>不超过10个字符</span>
                        </div>-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">门店编号</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.storeNum" placeholder=""  value="" class="form-control light-input" maxlength="20">
                            </div>
                            <span class="color_hint">不超过20个字符,不填系统会默认分配一个</span>
                        </div>
                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">类目</label>
                            <div class="col-sm-10" style="padding-left: 0px">
                                <div class="row">
                                    <div class="col-sm-2">
                                        <select name="category_one" class="form-control" id="category_one" ></select>
                                    </div>
                                    <div class="col-sm-2">
                                        <select name="category_two" class="form-control" id="category_two" ></select>
                                    </div>

                                    <script src="/res/plugins/jiuyue/category_select.js"></script>
                                    <script type="text/javascript">
                                        new category('category_one', 'category_two', '${category_one!}', '${category_two!}');
                                    </script>
                                </div>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>电话</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.telephone" placeholder=""  value="" class="form-control light-input" maxlength="35" required="true">
                            </div>
                            <span class="color_hint">门店的电话（纯数字，区号、分机号均由“-”隔开）</span>

                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">门店类别</label>
                            <div class="col-sm-3">
                                <select name="brandStore.storeCategoryId" value="" class="form-control light-input" style="height: 31px;padding: 0px 12px">
                                    <option value="">请选择...</option>
                                    <%for(list in allStoreCategoryList!){%>
                                    <option value="${list.id}"<%if (list.id == brandStore.storeCategoryId!){%> selected<%}%>>${list.name}</option>
                                    <%}%>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>地区</label>

                            <div class="col-sm-10" style="padding-left: 0px" required>
                                <div class="row">
                                    <div class="col-sm-2">
                                        <select name="brandStore.province" class="form-control light-input" id="location_p" required=></select>
                                    </div>
                                    <div class="col-sm-2">
                                        <select name="brandStore.city" class="form-control light-input" id="location_c" required=></select>
                                    </div>
                                    <div class="col-sm-2">
                                        <select name="brandStore.district" class="form-control light-input" id="location_a"></select>
                                    </div>
                                    <script src="/res/plugins/jiuyue/region_select.js"></script>
                                    <script type="text/javascript">
                                        new PCAS('brandStore.province', 'brandStore.city', 'brandStore.district', '', '', '');
                                    </script>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>详细地址</label>
                            <div class="col-sm-10" style="padding-left: 0px">
                                <div class="row">
                                    <div class="col-sm-3" style="width: 17%">

                                        <input type="hidden" class="suggestaddress" id="suggestId" value="" style="width: 228px">
                                        <input type="text" id="suggestId1" name="brandStore.address" value="" required="true" class="form-control light-input">
                                    </div>
                                    <div class="col-sm-2">
                                        <span class="input-group-btn">
                                        <button name="" type="button" id="positioning" class="hive-btn hive-btn-primary">搜索</button>
                                        </span>
                                    </div>

                                    <div class="col-sm-2">
                                        <select name="map_type" class="form-control light-input" style="height: 31px;padding: 0px 12px">
                                            <option value="1" data-mapty="tencent">腾讯地图</option>
                                            <option value="0" data-mapty="baidu">百度地图</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-5">
                                        <span style="color: red">注意：这个只是模糊定位，准确位置请地图上标注!</span>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-4" >
                                <div id="l-map">
                                    <i class="icon-spinner icon-spin icon-large"></i>地图加载中...
                                </div>

                                <div class="row" id="r-result">
                                    <div class="col-sm-4" style="padding-left: 0px">
                                        <input type="text" class="form-control light-input" id="lng" name="brandStore.longitude" value="" />
                                    </div>
                                    <div class="col-sm-4" style="padding-left: 0px">
                                        <input type="text" class="form-control light-input" id="lat" name="brandStore.latitude" value=""  />
                                    </div>
                                </div>
                            </div>

                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">负责人</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.personInCharge" value="" class="form-control light-input" maxlength="10">
                            </div>
                        </div>

                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">推荐</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.recommend" value="" class="form-control light-input" maxlength="200">
                            </div>
                            <span class="color_hint">推荐品，餐厅可为推荐菜；酒店为推荐套房；景点为推荐游玩景点等，针对自己行业的推荐内容200字以内(选填)</span>
                        </div>-->
                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">特色服务</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.special" value="" class="form-control light-input">
                            </div>
                            <span class="color_hint">特色服务，如免费wifi，免费停车，送货上门等商户能提供的特色功能或服务(选填)</span>
                        </div>-->
                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">商户简介</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.introduction" value="" class="form-control light-input" maxlength="300">
                            </div>
                            <span class="color_hint">商户简介，主要介绍商户信息等300字以内(选填)</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">营业时间</label>
                            <div class="col-sm-3">
                                <input type="text" name="brandStore.open_time" value="" class="form-control light-input">
                            </div>
                            <span class="color_hint">营业时间，24 小时制表示，用“-”连接，如8:00-20:00(选填)</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">人均价格</label>
                            <div class="col-sm-3">
                                <input 	digits="true"  min="1" type="" name="brandStore.avg_price" value="" class="form-control" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;">
                            </div>
                            <span class="color_hint">人均价格，大于0 的整数(选填)</span>
                        </div>-->
                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<% include("../inc/input_js.html"){}%>
<!-- 自定义js -->
<script src="/res/plugins/jiuyue/lbs_map.js"></script>
<script src="https://static.9hive.cn/global/vendor/map/select-address.js"></script>
<script>
    var initaddress=$(".suggestaddress").val();
    if(initaddress==""){
        initaddress="上海市杨浦区政益路28号";
    }
    var lng=$("#lng").val();
    if(lng==""){
        lng=121.525808;
    }
    var lat=$("#lat").val();
    if(lat==""){
        lat=31.308563;
    }

$("#location_p").change(function () {
    var location_p=this.value;
    var location_c= $("#location_c").val();
    $(".suggestaddress").val(location_p+location_c);
});
$("#location_c").change(function () {
    var location_c=this.value;
    var location_p= $("#location_p").val();
    $(".suggestaddress").val(location_p+location_c);
});
$("#suggestId1").on("mouseleave",function () {
    var location_p= $("#location_p").val();
    var location_c= $("#location_c").val();
    var address=this.value;
    $(".suggestaddress").val(location_p+location_c+address);
})
</script>
<script type="text/javascript">
    $(function () {
        //地图加载
        G.logic.map.init();

        //联动地址加载
        /*var draw_options = {
            ajax: '/location/getlist',
            custom: 2,
            editing:!0, //编辑状态
            iddatas:'0'
        };*/
       //var draw_sel = new G.util.selectaddress(draw_options);
    })
</script>
</body>

</html>


